""" Manager 支持 python数据对象 dict, list共享内存

"""
from multiprocessing import Process, Manager


def f(d, l):
    d["name"] = "Tom"
    d["age"] = 18
    d[1] = 1
    d[0.25] = None

    l.reverse()


if __name__ == "__main__":
    with Manager() as manager:
        d = manager.dict()
        l = manager.list(range(10))

        proc = Process(target=f, args=(d, l))
        proc.start()
        proc.join()

        print(d)
        print(l)
